#include <Windows.h>
#include <sphelper.h>
#pragma warning(disable:4995)
#include <iostream>
#include "Speaker.h"

#ifndef GRAMMAR_H
#define GRAMMAR_H

const int RULE_START_GAME =1;
const int RULE_PAUSE_GAME =2;
const int RULE_RESUME_GAME =3;
const int RULE_RESET_GAME =98;
const int RULE_STOP_GAME =99;

const int RULE_DIRECTION_UP = 51;
const int RULE_DIRECTION_DOWN = 52;
const int RULE_DIRECTION_LEFT = 53;
const int RULE_DIRECTION_RIGHT = 54;

const int RULE_RUNTIME_GRAB =11;
const int RULE_RUNTIME_GO =12;

const int RULE_CONFIRM=21;
const int RULE_CANCEL=22;

class Grammar{

public:
	Grammar(CComPtr<ISpRecoGrammar> cpGram);
	~Grammar(void);
	void init(void);

private:
	CComPtr<ISpRecoGrammar> cpGram;
	HRESULT hr;		

	//States used in grammar
	SPSTATEHANDLE hStartGame_First;
	SPSTATEHANDLE hStartGame_Second;
	SPSTATEHANDLE hStopGame_First;
	SPSTATEHANDLE hStopGame_Second;
	SPSTATEHANDLE hPauseGame_First;
	SPSTATEHANDLE hPauseGame_Second;
	SPSTATEHANDLE hResumeGame_First;
	SPSTATEHANDLE hResumeGame_Second;
	SPSTATEHANDLE hResetGame_First;
	SPSTATEHANDLE hResetGame_Second;
	SPSTATEHANDLE hDirection;
	SPSTATEHANDLE hRunTimeCommands;
	SPSTATEHANDLE hConfirm;
	SPSTATEHANDLE hCancel;


	//Setup methods
	void defineRunTimeCommands(void);
	void defineStart(void);
	void defineStop(void);
	void defineResume(void);
	void defineReset(void);
	void definePause(void);
	void defineConfirm(void);
	void defineDirections(void);



};
#endif